const createColumns = function (that) {
  const width = {
    num: 100,
    action: 80
  }
  let columns = [ {
    title: '序号',
    key: 'index',
    width: 80,
  }, {
    title: '姓名',
    key: 'realname',
  }, {
    title: '用户名',
    key: 'username',
  }, {
    title: '手机号',
    key: 'mobilePhone',
  }, {
    title: '创建人',
    key: 'createBy',
  }, {
    title: '创建时间',
    key: 'createTime',
  }, {
    title: '状态',
    key: 'enabled', // 状态
    align: 'center',
    fixed :'right',
    width:100,
    render: (h, params) => {
      return h('i-switch', {
        props: {
          size: 'large',
          trueValue: '1',
          falseValue: '0',
          disabled:true,
          value: params.row.enabled,
        },
				 style: {
				  marginLeft: '5px',
				},
        on: {
          'on-change': (status) => {
            let data = {
              row: params.row,
              status: status,
            }
            that.switchOnChange(data);
          }
        },
      }, [
        h('span', {
          slot: 'open'
        }, '启用'),
        h('span', {
          slot: 'close'
        }, '停用')
      ]);
    },
  }, {
    title: '操作',
    key: 'action', // 操作
    width: 80,
    fixed :'right',
    render: (h, params) => {
      let arr = [];
        arr.push(h('Button', {
          props: {
            type: 'text',
            size: 'small',
            ghost: true,
            shape: "circle"
          },
          style: {
            color:"#2D8CF0"
          },
          on: {
            click: () => {
              that.goManage(params.row);
            }
          }
        }, '管理'))
      return h('div', {
        style: {
          textAlign: 'left'
        },
      }, arr);
    }
  }]

  return columns
}

export default createColumns